package com.lanmaoly.cunzheng.queue;

import java.util.ArrayDeque;
import java.util.Iterator;

public class ArrayQueueTest {

    public static void main(String[] args) {
        ArrayDeque<String> deque = new ArrayDeque<>();

        deque.push("3");
        deque.push("2");
        deque.push("1");

        System.out.println(deque.peek());
        System.out.println(deque.peekFirst());
        System.out.println("---------------------------");
        Iterator<String> iterator = deque.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
        System.out.println("---------------------------");
        for (String s : deque) {
            System.out.println(s);
        }
    }
}
